package org.neframework.webtest.action_rest;

import java.util.List;
import java.util.Map;

import org.apache.derby.tools.sysinfo;
import org.neframework.webtest.base.BaseController;
import org.neframework.webtest.model.t_s_article;
import org.neframework.webtest.model.t_s_bank;
import org.neframework.webtest.service.ArticleService;

import com.tmsps.neframework.mvc.annotation.Controller;
import com.tmsps.neframework.mvc.annotation.RequestMapping;

@Controller
public class ArticleController extends BaseController {

	private static final ArticleService articleService = new ArticleService();

	@RequestMapping("/art_list")
	public String art_list(String cate,String bank_id) {
		page.setPageSize(20);
		List<Map<String, Object>> list = articleService.selectArticleList(null,
				cate,bank_id, sort_params, page);

		req.setAttribute("cate", cate);
		req.setAttribute("list", list);
		return "/jsp_net/list.jsp";
	}

	@RequestMapping("/d")
	public String d(String kid) {
		t_s_article article = (t_s_article) oc.findObjById(kid,
				t_s_article.class);

		t_s_bank bank = (t_s_bank) oc.findObjById(article.getBank_id(),
				t_s_bank.class);

		req.setAttribute("article", article);
		req.setAttribute("bank", bank);
		return "/jsp_net/d.jsp";
	}

}
